package cn.net.cfss.fgbp.api.console.inte;

import cn.net.cfss.fgbp.api.console.constant.Constants;
import cn.net.cfss.fgbp.api.console.dto.SysMenuDto;
import cn.net.cfss.fgbp.api.console.vo.SysRoleMenuVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author oygq
 * @title: IRoleAppService
 * @description: 角色菜单接口类
 * @date 2019/4/3 11:18
 */
@FeignClient(name = Constants.SPI_SERVER_NAME)
@RequestMapping("roleMenu")
public interface ISysRoleMenuService {

    @RequestMapping(value = "/add", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean insert(@RequestBody SysRoleMenuVo vo);

    @RequestMapping(value = "/edit", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean update(@RequestBody SysRoleMenuVo vo);

    @RequestMapping(value = "/delete/{roleMenuId}", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean delete(@PathVariable(value = "roleMenuId") Long roleMenuId);

    @RequestMapping(value = "/deleteBatch", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean deleteBatch(@RequestBody Long[] roleMenuIds);

    @RequestMapping(value = "/query/{roleId}", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public List<Long> queryByRoleId(@PathVariable(value = "roleId") Long roleId);

    @RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean deleteByMenus(@RequestBody SysRoleMenuVo vo);

    @RequestMapping(value = "/queryMenuByRoleId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public Map<Long, List<String>> queryMenuByRoleId(@RequestBody List<Long> roles);

    @RequestMapping(value = "/queryProjectByRoleId", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public Map<Long, List<String>> queryProjectByRoleId(@RequestBody List<Long> roles);

}
